/*
 * Register.java
 *
 * Creada el 27/01/2012, 02:33:49 PM
 *
 * Clase Java desarrollada por Edgar Ramos para 7i Software Factory el día 27/01/2012
 *
 * Para informacion sobre el uso de esta clase, asi como bugs, actualizaciones, o mejoras enviar un mail a
 * eramos@7i.com.mx
 *
 * Desarrollado por la célula de desarrollo de Zacatecas
 *
 */
package com.grupoquark.cic.model.register;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Temporal;
import org.apache.log4j.Logger;

/**
 * @author Edgar Ramos
 * @version 1.0
 * @author-mail eramos@7i.com.mx @date 27/01/2012
 */
@Entity
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public class Register implements Serializable
{
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private long id;
    @Temporal(javax.persistence.TemporalType.DATE)
    @Column(name = "registration_day")
    private Date registrationDay;
    //Other constants
    private transient static final Logger LOG = Logger.getLogger(Register.class);

    protected Register()
    {


        if (LOG.isTraceEnabled())
        {
            LOG.trace("Empty Register created");
        }
    }

    public Register(Date registrationDay)
    {

        this.registrationDay = (Date) registrationDay.clone();
        if (LOG.isTraceEnabled())
        {
            LOG.trace("Register created: " + registrationDay);
        }
    }

    public Date getRegistrationDay()
    {
        return registrationDay;
    }

    public void setRegistrationDay(Date registrationDay)
    {
        this.registrationDay = registrationDay;
    }

    public long getId()
    {
        return id;
    }

    protected void setId(long id)
    {
        this.id = id;
    }

    @Override
    public String toString()
    {
        return "Register{" + "id=" + id + ", registrationDay=" + registrationDay + '}';
    }
}
